$def with (form, text)

<!doctype html>

<html>

    <head>
        <title>TAP Interface with webpy/ajax</title>
        <link rel="stylesheet" type="text/css" href="/static/style.css" />
        
        <script type="text/javascript" src="/static/js/jquery.js"></script>
        
        <script type="text/javascript" src="static/js/functions.js"></script>
        <script type="text/javascript">
        jQuery(document).ready(function() {
        	
        	var xhr;
        	
        	jQuery('#loading_options').fadeOut('normal');
            jQuery(".button").click(function() {
                    var input_string = $$("input#textfield").val();
                    jQuery('#results').fadeOut('normal');
                    jQuery('#load').fadeIn('normal');
                    jQuery('#loading_options').fadeIn('normal');
                    
    				xhr= jQuery.ajax({
                            type: "POST",
                            data: {textfield : input_string},
                            success: function(data) {
                            jQuery('#results').html(data).hide().fadeIn(1500);
                            jQuery('#loading_options').hide();
                            jQuery('#load').hide();
           					},
                    });
                    return false;
              });
            
            jQuery(".myButtonStop").click(function() {
                jQuery('#load').fadeOut('fast');
                jQuery('#loading_options').fadeOut('normal');
                xhr.abort();
                return false;
         	 });
            });
        </script>
        
        
        <link rel="icon" 
      	            type="image/png" 
                              href="static/icon.png">
                              

	<!--[if lte IE 6]>
			<style type="text/css" media="screen">
				#header div{
					background-image: none;
					filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='overlay.png', sizingMethod='scale');
				}
			</style>
	<![endif]-->
    </head>
    
    <body>
	
	<div id="header">
				<!-- Div is for Shadow Overlay	-->
				<div>
					<h1>TAP / ADQL query portal 1.0</h1>	
				</div>
	</div>
	<br>
	<div id="searchbar">	
		<div id="load"> </div>
	        <form class="form" method="post"> 
		        $:form.render()
		        <input class="button" type="submit" value="send"/>
	        </form>
	</div>

	<div id="loading_options">
		
		<a href="#" class="myButtonStop">Stop query</a>
		<a href="#" class="myButtonEmail">Send via email</a>
	</div>

    <br><br>
	<div id="results">$text</div>
    <br><br>
       
    </body>

</html>

